#!/usr/bin/python3
''' 利用python实现查找指定目录下的某个后缀名.py文件并显示统计的功能'''
import os


list_py = []
path = input("please input the path:")
for path, f_dir, f_name in os.walk(path):
    for i in f_name:
        if os.path.splitext(i)[1] == '.py':
            print(os.path.join(path, i))
            list_py.append(os.path.join(path, i))


print(len(list_py))
